module MessagesHelper
  def message_name_value
    if action_name == "show" 
      h @message.name 
    else
      value  = @message.name 
      text_field_tag "message[name]", value
    end
  end

  def message_body_value
    if action_name == "show" 
      @message.body
    else
      text_area_tag "message[body]", @message.body
    end
  end

  def message_expires_on_value
    if action_name == "show"
      h @message.expires_on 
    else
      datetime_select "message[expires_on]", @message.expires_on
    end
  end

end
